1. Field of the Invention
This invention relates to a novel image processing apparatus wherein an image obtained from imaging means is pre-processed so that features of an object which has a profile having features which cannot be grasped readily only by calculation of the center of gravity such as, for example, a head drum for a video tape recorder can be extracted readily.
2. Description of the Related Art
Conventionally, most of image processing apparatus for an industrial robot are constructed so that an instruction can be delivered from a robot program to the image processing apparatus and extraction of features such as measurement of a perimeter, measurement of a superficial content, detection of the center of gravity, calculation of a moment and so forth of an object for recognition can be performed under one command and so that results of processing of the image processing apparatus can be utilized readily.
Referring to FIGS. 18 to 21, there is shown a recognizing process of a part handled on an assembly line for electronic appliances. An area indicated by cross hatching in a picture frame F of a photographed image I represents an object for recognition while a white ground represents the background.
A part a has a profile wherein a portion c of a ring portion b projects radially outwardly as seen in FIGS. 18 to 21, and recognition of such projection is conventionally executed in the following procedure.
(1) First, the center O of an inner circle of the ring portion b of the part a is detected using a gravity center detecting function (refer to FIG. 19).
(2) A circular path d (indicated by an alternate long and two short dashes line in FIG. 20) of a suitable radius r centered at the detected center O of gravity is determined.
(3) The circular path d thus determined is traced in the direction indicated by a broken line arrow mark A, whereupon the projection c is recognized (refer to FIG. 21).
The method described above, however, has problems as described below.
(1) Since the tracing method centered at the center of gravity is liable to be influenced by noise, if dots e originating from noise are present in the proximity of the projection c as shown in FIG. 22, then they may be mistaken as portions of the projection. Noise removing processing is required in order to prevent such a detection error, and a large amount of calculation such as a filtering process is necessary, which works against the requirement for enhancement in speed of a calculating process.
(2) Stains such as f sticking to a surface of a part as shown in FIG. 23 may have an influence upon the accuracy in detection, or a portion g which must originally be detected as part of a projection may shine white due to illumination so that it may be regarded as the background, resulting in continuation of tracing of the circular path. In either instance, a loss of information occurs disadvantageously.
Further, when an edge portion i of a projection h inclined slightly with respect to another portion j contiguous therewith as shown in FIG. 24, the tracing direction does not coincide with the direction of a normal to the edge portion i of the projection h, and consequently, a small difference .delta. in diameter between different trace circles k and k' will appear as a large error .DELTA. in detected position of the projection h.
(3) In a condition wherein the problem described just above occurs, a calculation may be formed wherein low frequency components of spatial frequencies of an image are processed by moment calculation (calculation wherein squares of distances from a reference point are multiplied by an amount corresponding to a density at a minute piece and then all of such products are added) in order to avoid the problem.
If moment calculation is performed for the image of the part shown in FIG. 18, then the center of gravity of the part a will be positioned in the proximity of the center O of the inner circle as shown in FIG. 25(a), and if a portion around the center O is shown in an enlarged scale, then the center of gravity must originally be positioned, as indicated by a point G of FIG. 25(b), on a half-line L which extends from the center O of the inner circle of the ring portion b passing a central portion of the projection c.
However, because of an error in detection of the ring portion b, the center of gravity is sometimes displaced from the line L, for example to a point G' or G". Since such an error in the proximity of the center O appears as a greater displacement from the direction of the half-line L as the distance from the center O increases as seen from the broken lines, it is difficult to detect the direction of the projection c with a high degree of accuracy.
In summary, images which cannot be recognized readily by the conventional method include an image which has a uniform portion centered at the center of gravity, an image which includes a block at a position other than a position at which a feature is to be extracted and spaced away from the center of gravity, and so forth. In other words, images wherein a position which is understood as the center of a part and a position of the center of gravity of the part are near each other are difficult to recognize.
By the way, almost all of common assembly processes involve the former, that is, images which have a uniform portion at the center of gravity. Accordingly, if images which have a uniform portion around the center of gravity can be removed by any method from photographed images, then the latter, that is, images which include a block at a position spaced away from the center of gravity, can be recognized readily.